package cn.tedu.pethospital.pet.controller;

import cn.tedu.pethospital.base.response.JsonResult;
import cn.tedu.pethospital.pet.pojo.dto.PetQuery;
import cn.tedu.pethospital.pet.pojo.vo.PetVO;
import cn.tedu.pethospital.pet.service.PetService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Slf4j
@RestController
@RequestMapping("/v1/pet")
@Api(tags = "宠物管理")
public class PetController {
    @Autowired
    private PetService petService;

    @GetMapping("select")
    public JsonResult selectPet(PetQuery petQuery){
        log.debug("查询宠物：petQuery={}" ,petQuery);
        List<PetVO> list = petService.selectPet(petQuery);
        return JsonResult.ok(list);
    }
}
